<template>
  <div>
    <el-card>
      <el-form :inline="true" label-width="110px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="机构:">
              <el-select v-model="formInline.institution" placeholder="请选择" clearable  class="ibput">
                <el-option v-for="(item,index) in dividerList" :label="item.companyName" :value="item.companyCode" :key="index">
                  {{item.label}}</el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="应交月：">
              <el-date-picker
                v-model="formInline.datetimerange"
                type="monthrange"
                style="width:50%;"
                range-separator="至"
                start-placeholder="开始月份"
                end-placeholder="结束月份">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="渠道:">
              <el-select v-model="formInline.channel" placeholder="请选择" clearable>
                <el-option label="个险" value="01"></el-option>
                <el-option label="银保" value="02"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="交次:">
              <el-select v-model="formInline.payTime" placeholder="请选择" clearable>
                <el-option label="二次" value="2"></el-option>
                <el-option label="三次" value="3"></el-option>
                <el-option label="四次及以上" value="4"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="是否考核件:">
              <el-select v-model="formInline.EvaluationPiece" placeholder="请选择" clearable>
                <el-option label="是" value="0"></el-option>
                <el-option label="否" value="1"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="是否大单:">
              <el-select v-model="formInline.BigTicket" placeholder="请选择" clearable>
                <el-option label="是" value="0"></el-option>
                <el-option label="否" value="1"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="保单状态:">
              <el-select v-model="formInline.PolicyStatus" placeholder="请选择" clearable>
                <el-option label="失效" value="0"></el-option>
                <el-option label="有效" value="1"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div style="float: right; margin: 20px 0;">
          <el-button type="primary" @click="seach" size="mini">查询</el-button>
          <el-button type="primary" @click="reset" size="mini">导出</el-button>
        </div>
    </el-card>
    <el-card>
      <el-table :data="tableList" max-height="420" style="width: 100%">
        <el-table-column width="110" label="保单号" prop="bbbb" align="center" />
        <el-table-column width="110" label="管理机构" prop="dddd" align="center" />
        <el-table-column width="110" label="保单状态" prop="eeee" align="center" />
        <el-table-column width="110" label="销售渠道" prop="ffff" align="center" />
        <el-table-column width="80" label="是否大单" prop="gggg" align="center" />
        <el-table-column width="90" label="是否考核件" prop="hhhh" align="center" />
        <el-table-column width="110" label="保费" prop="iiii" align="center" />
        <el-table-column width="110" label="生效日期" prop="jjjj" align="center" />
        <el-table-column width="110" label="下次交费日期" prop="kkkk" align="center" />
        <el-table-column width="110" label="代理人" prop="cccc" align="center" />
        <el-table-column mix-width="110" label="收费地址" prop="mmmm" align="center" />
        <el-table-column mix-width="110" label="分单地址" prop="nnnn" align="center" />
        <el-table-column mix-width="110" label="行政区域" prop="mmmm" align="center" />
        <el-table-column mix-width="110" label="分单区域" prop="nnnn" align="center" />
      </el-table>
    </el-card>
  </div>
</template>
<script>
import { getCompanyList } from '../../../api/renewalPlatformApi/index';
export default {
  data(){
    return {
      formInline:{
        institution:"",
        datetimerange:[],
        channel:"",
        payTime:"",
        EvaluationPiece:"",
        BigTicket:"",
        PolicyStatus:""
      },
      dividerList:[],
      tableList:[]
    }
  },
  created(){
    this.getList()
  },
  methods:{
    getList() {
      getCompanyList({ companyType: '3',parentCode:'8601' }).then((res) => {
        if (res.code === 200) {
          res.data.forEach(item => {
            let temp = {
              companyCode: item.companyCode,
              companyName: item.companyName,
              placeCode: item.placeCode,
              isShowSon: false,
              checked: [],
              cityList: []
            }
            this.dividerList.push(temp);
          });
        }
      }).finally(() => {})
    },
    seach(){
      if(!this.formInline.institution){
        this.$message.error('请选择机构!');
        this.tableList = []
        return
      }
      this.tableList =  [{
        aaaa: '2023-08', bbbb: '123121', cccc: '左思雨',
        dddd: '人寿无锡分公司', eeee: '生效', ffff: '个险',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '40',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      }, {
        aaaa: '2023-08', bbbb: '123122', cccc: '时林',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      }, {
        aaaa: '2023-08', bbbb: '123123', cccc: '阎华雯',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '35',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      }, {
        aaaa: '2023-08', bbbb: '123124', cccc: '韩超',
        dddd: '人寿无锡分公司', eeee: '生效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '14',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      }, {
        aaaa: '2023-08', bbbb: '123121', cccc: '王建',
        dddd: '人寿无锡分公司', eeee: '生效', ffff: '个险',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '40',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      }, {
        aaaa: '2023-08', bbbb: '123123', cccc: '杨志嫣',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '35',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
       {
        aaaa: '2023-08', bbbb: '123122', cccc: '高凤建',
        dddd: '人寿无锡分公司', eeee: '有效', ffff: '银保',
        gggg: '是', hhhh: '否', iiii: '20', jjjj: '2023-10-18', kkkk: '2023-10-30', llll: '45',  mmmm: '江苏省无锡市',
         nnnn: '江苏省无锡市', oooo: '21', pppp: '60', qqqq: '50', rrrr: '68'
      },
    ]
    },
    reset(){

    },
  }
}
</script>